# Contributor: Marian Buschsieweke <marian.buschsieweke@posteo.net>
# Maintainer: Marian Buschsieweke <marian.buschsieweke@posteo.net>
pkgname=py3-apio
pkgver=0.9.5
pkgrel=0
pkgdesc="Open source ecosystem for open FPGA boards"
url="https://github.com/FPGAwars/apio"
arch="noarch"
license="GPL-2.0-only"
depends="
	py3-click
	py3-colorama
	py3-flit-core
	py3-pyserial
	py3-requests
	py3-semantic-version
	py3-setuptools
	python3
	scons
	"
makedepends="
	py3-gpep517
	py3-wheel
	"
checkdepends="
	py3-pytest
	"
subpackages="
	$pkgname-pyc
	"
source="
	$pkgname-$pkgver.tar.gz::https://github.com/FPGAwars/apio/archive/refs/tags/v$pkgver.tar.gz
	"
builddir="$srcdir/apio-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest -v test
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
15785cef6e7109c4cc15ccb7b7fc790f4800283903de454b0a2d3c969605d5a3fd8b7b2e62eedcf1989b4e360cf83e8b4167beea88db2b4dd615f13ea69fb33b  py3-apio-0.9.5.tar.gz
"
